package com.intelligent.ispc.core.service;

import com.intelligent.ispc.core.dto.GroupDto;
import com.intelligent.ispc.core.dto.ProjectDto;
import com.intelligent.ispc.core.dto.UserDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by Can.Guan on 2016/5/3.
 */
public interface GroupService {
    void saveGroup(GroupDto groupDto);

    void updateGroup(GroupDto groupDto);

    void deleteGroup(String id);

    void isExistGroupName(String name);

    void checkGroupName(Long id, String name);

    GroupDto findById(String id);

    GroupDto findByName(String name);

    List<GroupDto> findAllGroups();

    List<GroupDto> searchGroup(Map<String, Object> searchParams);

    Page<GroupDto> searchGroup(Map<String, Object> searchParams, Pageable pageable);

    void assignUsersForGroup(String groupId, List<String> userIds);

    void deleteUsersForGroup(String groupId, List<String> userIds);

    List<UserDto> findUsersForGroup(String groupId);

    Page<UserDto> findUsersForGroupByName(Map<String, Object> searchParams, Pageable pageable);

    List<UserDto> findUsersForNotInThisGroup(String groupId);

    Page<UserDto> findUsersForGroup(String groupId,Pageable pageable);

    void assignProjectsForGroup(String groupId, List<String> projectIds);

    void deleteProjectsForGroup(String groupId, List<String> projectIds);

    List<ProjectDto> findProjectsForGroup(String groupId);

    Page<ProjectDto> findProjectsForGroupByName(Map<String, Object> searchParams, Pageable pageable);

    List<ProjectDto> findProjectsForNotInThisGroup(String groupId);

    Page<ProjectDto> findProjectsForGroup(String groupId,Pageable pageable);

    GroupDto findUsersAndProjectsForGroup(String groupId);

    List<GroupDto> findGroupsForUser(String userId);

}
